package com.glorystone.ins.exception;

import com.glorystone.ins.enums.CreditError;

/**
 * @author liuming
 * @date 2017年11月6日 下午6:02:59
 */
public class CreditException extends RuntimeException {
	private static final long serialVersionUID = 9167212208179615650L;

	protected int errorCode;
	protected String message;
	protected String data;

	public CreditException(final CreditError appError) {
		super();
		this.errorCode = appError.getErrorCode();
		this.message = appError.getMessageKey();
	}

	public CreditException(final CreditError appError, final String data) {
		super();
		this.errorCode = appError.getErrorCode();
		this.message = appError.getMessageKey();
		this.data = data;
	}

	public int getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

}
